package com.rgh.pecunia.domain;

import java.util.Date;

import javax.persistence.Id;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Cached;

@Cached
@SuppressWarnings("unchecked")
public class Transfer implements BusinessEntity {

    private static final long serialVersionUID = 1L;
    
    // ID
    @Id Long id;
    
    // Source account
    Key<Account> source;
    
    // Destination account
    Key<Account> destination;

    // Created at
    Date creation;
    
    // Updated at
    Date updated;
    
    // Amount transfered
    Double amount;
    
    // Description
    String description;

    public Transfer() {
        this.amount = 0d;
        this.creation = new Date();
        this.updated = new Date();
    }

    @Override
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Date getCreation() {
        return creation;
    }

    public void setCreation(Date creation) {
        this.creation = creation;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Key<Account> getDestination() {
        return destination;
    }

    public void setDestination(Key<Account> destination) {
        this.destination = destination;
    }

    public Key<Account> getSource() {
        return source;
    }

    public void setSource(Key<Account> source) {
        this.source = source;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }
}
